package com.kancy.learn.rpc.rmi.zookeeper.server;

import com.kancy.learn.rpc.rmi.api.IMessageService;
import com.kancy.learn.rpc.rmi.common.util.LocalIpUtil;
import com.kancy.learn.rpc.rmi.service.impl.MessageServiceImpl;

/**
 * @author kancy
 * @version 1.0
 * @date 2019/1/31 10:54
 */
public class ZookeeperServerApplication {
    private final static ServiceProvider serviceProvider = new ServiceProvider();
    public static void main(String[] args) {
        // 发布服务
        IMessageService service = null;
        try {
            service = new MessageServiceImpl();
            serviceProvider.publish(service, LocalIpUtil.getIp(), 9002);
            System.out.println(IMessageService.class.getName() + " 服务发布成功！");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
